package com.aqie.rabbit.test.fourThread;

class Data {

    private int j = 0;

    public synchronized void add() {

        System.out.println(Thread.currentThread().getName() + "对j加1，当前j=" + (++j));
    }

    public synchronized void dec() {

        System.out.println(Thread.currentThread().getName() + "对j减1，当前j=" + (--j));
    }
}
